"""
@version:python3
@author:大橘为重
@file:12-QLineEdit-案例1.py
@time:2022/2/25 21:05
"""
# 0、导入需要的包和模块
from PyQt5.Qt import *
import sys


# 1、创建一个应用程序对象
app = QApplication(sys.argv)

# 2、控件操作
# 创建控件、设置控件、事件和信号的处理
# 2.1 创建控件
window = QWidget()
# 2.2 设置控件
window.setWindowTitle("QLineEdit-案例")
window.resize(500,500)

le1 = QLineEdit(window)
le1.move(100,100)
# le1.setEchoMode(QLineEdit.NoEcho)
# le1.setEchoMode(QLineEdit.Password)
le1.setEchoMode(QLineEdit.PasswordEchoOnEdit)

le2 = QLineEdit(window)
le2.move(100,150)

btn = QPushButton(window)
btn.setText("按钮")
btn.move(100,125)
def copy():
    content = le1.text()
    le2.setText(content)
btn.pressed.connect(copy)





# 2.3 展示控件
window.show()

# 3、应用程序的执行，进入到消息循环
sys.exit(app.exec_())